<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<form action="" method="">
			<table border="1" cellspacing="0" cellpadding="10px" id="test_table">
				<tr>
					<th></th>
					<th>姓名</th>
					<th>性别</th>
					<th>年龄</th>
					<th>家庭住址</th>
				</tr>
				<tr>
					<td><input type="checkbox" name="" id="" value="" /></td>
					<td>张三1</td>
					<td name="se" value='1'>男</td>
					<td>19</td>
					<td>福建省新罗区</td>
				</tr>
				<tr>
					<td><input type="checkbox" name="" id="" value="" /></td>
					<td>张三2</td>
					<td name="se" value="0">男</td>
					<td>19</td>
					<td>福建省新罗区</td>
				</tr>
				<tr>
					<td><input type="checkbox" name="" id="" value="" /></td>
					<td>张三3</td>
					<td>男</td>
					<td>19</td>
					<td>福建省新罗区</td>
				</tr>
				<tr>
					<td><input type="checkbox" name="" id="" value="" /></td>
					<td>张三4</td>
					<td>女</td>
					<td>19</td>
					<td>福建省新罗区</td>
				</tr>
				<tr>
					<td><input type="checkbox" name="" id="" value="" /></td>
					<td>张三5</td>
					<td name="se" value="1" >男</td>
					<td>19</td>
					<td>福建省新罗区</td>
				</tr>
				<tr>
					<td><input type="checkbox" name="" id="" value="" /></td>
					<td>张三6</td>
					<td>女</td>
					<td>19</td>
					<td>福建省新罗区</td>
				</tr>
			</table>
			<input type="checkbox"  id="qxchk"  onclick="qxck()" />全选
			<input type="checkbox"  id="qxnan"  onclick="qnanck()" />全选男
			<input type="checkbox"  id="qxnv"   onclick="qxnvck()" />全选女
		</form>
	</body>
	<script>
		var objtest=document.getElementById('test_table');
		function qxck(){
			var tablname=objtest.getElementsByTagName('input');
			var chk=document.getElementById('qxchk');
			for (var i = 0; i < tablname.length; i++) {
				tablname[i].checked=chk.checked;
			}
		}
		function qnanck(){
			var tab=document.getElementsByName('se');
		console.log(tab[1].innerText);
		}

	</script>
</html>